import request from "@/utils/request";
//题目列表
// title	string	题目名称,非必传
export function questionList(params) {
  return request({
    url: "question",
    method: "get",
    params
  });
}
//删除题库   id
export function delQuestion(data) {
  return request({
    url: "question",
    method: "delete",
    data
  });
}
//题目详情  id
export function detailQuestion(params) {
  return request({
    url: "question/{id}",
    method: "get",
    params
  });
}
//添加修改 题目
// id	numeric	题目id(如果不传id则添加,传id则修改),非必传
//title	string	题目名称,必传
//sort	numeric	排序,非必传,默认为0
//answers	string	答案,非必传 [{"title":"肉","sort":"1"},{"title":"鱼","sort":"2"}]
export function AddEditQuestion(data) {
  return request({
    url: "question",
    method: "post",
    data
  });
}
